4.3.áLinux Guest Additions

Like the Windows Guest Additions, the VirtualBox Guest Additions for Linux take the form of a set of device drivers and system applications which may be installed in the guest operating system.

The following Linux distributions are officially supported:

Other distributions may work if they are based on comparable software releases.

The version of the Linux kernel supplied by default in SUSE and openSUSE 10.2, Ubuntu 6.10 (all versions) and Ubuntu 6.06 (server edition) contains a bug which can cause it to crash during startup when it is run in a virtual machine. The Guest Additions work in those distributions.

As with Windows guests, we recommend installation of the VirtualBox Guest Additions for Linux.

4.3.1.áInstalling the Linux Guest Additions

The VirtualBox Guest Additions for Linux are provided on the same ISO CD-ROM as the Additions for Windows described above. They also come with an installation program guiding you through the setup process, although, due to the significant differences between Linux distributions, installation may be slightly more complex.

Installation involves the following steps:

  1. Before installing the Guest Additions, you will have to prepare your guest system for building external kernel modules. This is exactly the same process as described in Sectioná2.3.2, “The VirtualBox kernel module”, except that this step must now be performed in your Linux guest instead of on a Linux host system, as described there.

  2. Mount the VBoxGuestAdditions.iso file as your Linux guest's virtual CD-ROM drive, exactly the same way as described for a Windows guest in Sectioná4.2.1.1, “Mounting the Additions ISO file”.

  3. Change to the directory where your CD-ROM drive is mounted and execute as root:

    sh ./VBoxLinuxAdditions-x86.run

    In a 64-bit Linux guest, use VBoxLinuxAdditions-amd64.run instead.

The VirtualBox Guest Additions contain several different drivers. If for any reason you do not wish to install them all, you can specify the ones which you wish on the command line - for example

sh ./VBoxAdditions.run x11

to install the X Window graphic drivers. Type in the command

sh ./VBoxAdditions.run help

for more information.

4.3.2.áVideo acceleration and high resolution graphics modes

In Linux guests, VirtualBox video acceleration is available through the X Window System. Typically, in today's Linux distributions, this will be the X.Org server. During the installation process, X will be set up to use the VirtualBox video driver. On recent Linux guests (that is, guests running X.Org server version 1.3 or later with the exception of Fedora 9) graphics modes can be selected by resizing the VirtualBox window using the mouse, or sending video mode hints using the VBoxManage tool. If you are only using recent Linux guests systems, you can skip the rest of this section. On older guest systems, whatever graphics modes were set up before the installation will be used. If these modes do not suit your requirements, you can change your setup by editing the configuration file of the X server, usually found in /etc/X11/xorg.conf.

VirtualBox can use any default X graphics mode which fits into the virtual video memory allocated to the virtual machine, as described in Sectioná3.7.1, “General settings”. You can also add your own modes to the X server configuration file. You simply need to add them to the "Modes" list in the "Display" subsection of the "Screen" section. For example, the section shown here has a custom 2048x800 resolution mode added:

Section "Screen"
        Identifier    "Default Screen"
        Device        "VirtualBox graphics card"
        Monitor       "Generic Monitor"
        DefaultDepth  24
        SubSection "Display"
                Depth         24
                Modes         "2048x800" "800x600" "640x480"
        EndSubSection
EndSection

4.3.3.áUpdating the Linux Guest Additions

The Guest Additions can simply be updated by going through the installation procedure again with an updated CD-ROM image. This will replace the drivers with updated versions. You should reboot after updating the Guest Additions.